class SiteController < ApplicationController
  def index
    checkParams(params)
    setParams(params)
  end
  def en
    checkParams(params)
    setParams(params)
  end



  def setParams(params)
    if (params[:landing])
      @landing = true
    end
    if !params[:news].blank?
      @share = News.where("id = ?", params[:news]).first
    end

    @news = News.order("date_from DESC").find(:all)
    @lookbook = Lookbook.order("sort DESC").find(:all)
    @banners = Banners.first

  end

  def checkParams(params)
    if params[:call]
      CCMailer.new_order(params[:call]).deliver
    end
    if params[:subscribe]
      CCMailer.new_news(params[:subscribe]).deliver
    end

  end
end
